package fragment;

import engine.AlternateStateThreadPoolExecutor;

public class LifeCycle extends QuasiComponentLifeCycle{

	private boolean alive = true;

	public void start() {
		cycle();
	}
	
	private void cycle(){
		Runnable me = new Runnable() {
			public void run() {
				architecture().step();				
				if(alive) LifeCycle.this.cycle();
			}
		};
	AlternateStateThreadPoolExecutor.processExe.execute(me);
	}

	@Override
	public void doSuicide() {
		alive = false;
	}

}
